
var searchLoginLock = false;
function searchLogin(){
	if(searchLoginLock==false){
		alert("Привет");
		searchLoginLock = true ;
		$("#spLoadData").css("display","inline-block");
		var login = $("#idLogin").val();
		$.post(
				"ajax/index.jsp", 
				{
					"action":"login_search",
					"login":login,
				},
				function(data) {
					if(data.status=='ok'){
						if(data.userlogin == "used"){
							$("#spLoginInfo").css("color","#FF0000");
						}
						if(data.userlogin == "free"){
							$("#spLoginInfo").css("color","#00FF00");
						}
						$("#spLoginInfo").html(data.userlogin);
						$("#spLoginInfo").css("display","inline-block");
						$("#spLoadData").css("display","none");
						
					}
				},"json"
			);
		searchLoginLock=false;
	}
}
